package com.hejia.alauda.service;

import java.util.List;

import com.hejia.alauda.entity.PushMessage;
import com.umeng.config.UmengConfig;

/**
 * 推送消息服务
 * 
 * @author hyr
 *
 */
public interface PushMessageService {

	/**
	 * 推送消息
	 * 
	 * @param pushMessage
	 *            推送消息
	 * @return true：推送成功，false：推送失败
	 * @throws Exception
	 */
	boolean pushMessage(UmengConfig config, PushMessage pushMessage) throws Exception;

	/**
	 * 发送iOS推送消息
	 * 
	 * @param pushMessage
	 *            推送消息
	 * @return true：推送成功，false：推送失败
	 * @throws Exception
	 */
	boolean pushIOSMessage(UmengConfig config, PushMessage pushMessage) throws Exception;

	/**
	 * 发送Android推送消息
	 * 
	 * @param pushMessage
	 *            推送消息
	 * @return true：推送成功，false：推送失败
	 * @throws Exception
	 */
	boolean pushAndroidMessage(UmengConfig config, PushMessage pushMessage) throws Exception;

	/**
	 * 查询定时推送消息
	 * 
	 * @return
	 */
	List<PushMessage> findTimingPushMessages();

	/**
	 * 推送定时消息
	 * 
	 * @param id
	 *            推送消息ID
	 * @throws Exception
	 */
	void pushTimingMessage(UmengConfig config, Long id) throws Exception;

	/**
	 * 删除推送消息
	 * 
	 * @param id
	 * @return
	 */
	public boolean deletePushMessage(Long id);

	/**
	 * 根据id取得推送消息
	 * 
	 * @param id
	 * @return
	 */
	PushMessage getPushMessageById(Long id);
}
